package com.mrjy.maintain.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.maintain.bo.IProgramPromoteInfoBo;

@Controller
@RequestMapping("/maintain/programPromote")
public class ProgramPromoteInfoController {
	
	@Autowired
	private IProgramPromoteInfoBo programPromoteInfoBo;
	
	/**
	 * 推广大使页面
	 * @param programId
	 * @param programType
	 * @return
	 */
	@RequestMapping("/list")
	@ResponseBody
	public Object list(@RequestParam Integer page
			,@RequestParam Integer rows
			,@RequestParam(required=true)Integer programId
			, @RequestParam(required=true)String programType,HttpSession session){
		return programPromoteInfoBo.queryPage(page,rows,programId,programType,session);
	}
	
	/**
	 * 点击赚xx元
	 * 插入记录
	 * @param programId
	 * @param programType
	 * @return
	 */
	@RequestMapping(value="/add",method=RequestMethod.POST)
	@ResponseBody
	public Object add(@RequestParam(required=true)Integer programId
			, @RequestParam(required=true)String programType,HttpSession session){
		return programPromoteInfoBo.txInsert(programId,programType,session);
	}

}
